package com.jfs.security.controller;

import com.jfs.result.Result;
import com.jfs.security.annotations.Log;
import com.jfs.security.service.LoginService;
import com.jfs.security.vo.LoginUserVo;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 登录控制器
 * @E-mail cwm3412638@163.com
 * @Author cwm
 * @Date 2022/8/5
 */
@RestController
@RequestMapping("/login")
@AllArgsConstructor
public class LoginController {
    private final LoginService loginService;

    /**
     * 登录
     *
     * @param loginUserVo
     * @return
     */
    @PostMapping
    @Log(name = "用户登录")
    public Result<String> login(@RequestBody LoginUserVo loginUserVo) {
        return this.loginService.login(loginUserVo);
    }
}
